Jump to content

Search the Community

Showing results for tags 'tutorial'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Marketplace
    • Hiring
    • Selling
  • General Discussions
    • All Hidden Developers
    • Public Discussion
    • ROBLOX Discussion
    • Programming & Scripting
    • Building & Modeling
    • Suggestions
  • Support
  • Applications
    • All Applications
  • Wiki
    • Official
    • User Submitted

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me

Found 3 results

  1. Currently, ROBLOX doesn't have a feature of detecting if the player is on either a tablet or phone yet. ROBLOX only can detect if the player is on a touch device. I found out a way to detect if the player is either in a tablet or phone. First off, go to ROBLOX Studio and insert a ScreenGui with a TextLabel in it. Change the size of the TextLabel to {0, 667},{0, 375}. The reason why we're doing that size is that it's the size of the biggest phone. Make the TextLabel BackgroundTransparency to 1, and change the TextSize to 100. This is what it should look like: Now, type in something in the TextLabel that will make the "TextFits" property false, or you can just put: "#################" Correct: . Incorrect: Now, duplicate the TextLabel. Change the size of the duplicate to {0, 1024},{0, 768}. The reason why we're doing that size is that it's the size of the smallest tablet. Copy the text, and clear out the of the duplicate text box. Now, paste the text back into the duplicate text box. The reason why we're doing that is to refresh the "TextFits" property. Make sure it fits. If it doesn't, just put the text to: "#################". Now, delete the duplicate text. Change the size of the text to {1,0},{1,0}. Now, when you test the game with a phone, the TextFits should be false. However, if you test it with a tablet, TextFits will be true. Here's an example script that can detect if the player is on Tablet, Computer, or Phone. Make sure it's a local script. function TabletOrPhone() if game:GetService('UserInputService').TouchEnabled == false then return 'Computer' else local s = Instance.new('ScreenGui',game.Players.LocalPlayer:FindFirstChild('PlayerGui')) local t = Instance.new('TextLabel',s) t.TextSize = 100 -- changes size t.Font = Enum.Font.SourceSans --changes font t.Text = '#################' --changes text t.Size = UDim2.new(1,0,1,0) --changes size if t.TextFits == true then s:remove() return 'Tablet' else if t.TextFits == false then s:remove() return 'Phone' end end end end print(TabletOrPhone()) --prints it
  2. Hello! I realized that remote events are hard for some people, and I wanted to clear the air that remote events are pretty easy! What are remote events? Games with Filtering Enabled, don't have access to a lot of things on the client side, so we have to use remote events to tell the server when to do something, like change a name of a text button! If you want more information, try checking out ROBLOX's article here First, let's create a remote event in replicated storage: Now, let's create a local script, and put it in StarterGui: In this script, you would usually put things before it, like loading client information, but we will keep it simple. print("OurEvent is about to fire!") game.ReplicatedStorage.OurEvent:FireServer() print("OurEvent has has fired!") What this does is when we say "game.ReplicatedStorage.OurEvent:FireServer()" we say "Hey, we would like our RemoteEvent to run that's in replicated storage." Let's create another script, but this time, a regular script in ServerScriptService: Now, in this script, ask the server to tell us when we fired our event. game.ReplicatedStorage.OurEvent.OnServerEvent:connect(function() -- put code to do after the event has fired end) I hope this improved your knowledge on RemoteEvents, these are the very basics, but I hope you learned something new!
  3. Hello, fellow Hidden Developers. I am Samuel, a developer and a staff member of HD, and today I want to show the newer scripters how to teleport a player to another position within the game. Let's get started! First, you want to make sure you have a nice workspace to work in. If you don't know how, just open ROBLOX Studio and click baseplate. Next, you are going to create a Part. If you don't know how, go to the Model tab and click Part. Now, we are going to insert a script into this part by right clicking on the part in your explorer, selecting Insert, then selecting Script. Make sure to put your script inside the brick you want to touch to teleport, do this by dragging the script into the Part. The script pane will show up, this is where you will edit your script. Make sure to clear the script, and delete print("Hello World!"). For our first line of code, we are going to make a Touched event. An event is something that get's triggered, therefore running the code within it. Your code should look something like this.. script.Parent.Touched:Connect (function(t) end) If it does, great! You've completed step 1 and we are closer to unlocking teleportation abilities! Next, we want to find the character model touching it. So let's see if the touched parent contains a head. We will do this using the FindFirstChild() method and an If Then statement. Your script should look like this.. script.Parent.Touched:Connect (function(t) if t.Parent:FindFirstChild("Head") then end end) Now you know that the parent of T is the character model. We will now use the MoveTo() method, it is what we use to move a Model, because Model's do not have a Position property. You will want to use the MoveTo method with the place you want to move to as the parameter. But, before we can do this, we need a place for it to move. Let's make a Part and name it TeleportBrick. This will be the brick you want your player to move to. Once it is made, we can finish up the script by putting in our MoveTo() method. Your script should look like this.. script.Parent.Touched:Connect (function(t) if t.Parent:FindFirstChild("Head") then t.Parent:MoveTo(game.Workspace.TeleportBrick.Position) end end) You now have a functioning script that moves the player, to the brick the script is inside. I hope this helped out to all you new scripters, and I cannot wait to see you grow to be amazing. Some info: end = is used to end a statement, or event/function. If there is a bracket that opens, you will close it at the end of your script. Parent = The parent / whatever the object is inside.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.