|
| 22 Jul 2016 09:00 PM |
| Hey I'm scripting a GUI that tells where they are in the game like those Pokemon games that say Route 1 and stuff like that on the side of the screen but I cant get the GUI to appear when the player steps on a certain part. I don't know what to do so here's the script. Post below what I should do |
|
|
| Report Abuse |
|
|
|
| 22 Jul 2016 09:01 PM |
That moment when you forget to post the code lol.
--[[ Scripted by Godlydeathdragon ]]-- local guiTriggered = script.Parent local Gui1Image = game.StarterGui.Gui1.ImageLabel
local function steppedOn(part) local parent = part.Parent if game.Players:GetPlayerFromCharacter(parent) then parent.Humanoid.WalkSpeed = 50 wait(.1) Gui1Image:TweenPosition(UDim2.new(-0.043, 0, -0.042, 0), 'Out', 'Bounce', 1) else Gui1Image:TweenPosition(UDim2.new(-0.743, 0, -0.042, 0), 'Out', 'Bounce', 1) end end
guiTriggered.Touched:connect(steppedOn)
thx |
|
|
| Report Abuse |
|
|
| |
|
Smeers
|
  |
| Joined: 14 Feb 2013 |
| Total Posts: 797 |
|
|
| 24 Jul 2016 01:09 PM |
| Assuming this is filteringenabled (everyone should develop with it by now), find the part in the Workspace inside of a localscript, then use a debounce and trigger it onTouched. |
|
|
| Report Abuse |
|
|
|
| 24 Jul 2016 01:14 PM |
| What do you mean by inside of a localscript |
|
|
| Report Abuse |
|
|
darthpyro
|
  |
| Joined: 18 Aug 2009 |
| Total Posts: 3569 |
|
|
| 24 Jul 2016 01:15 PM |
| You're moving the Gui in the StarterGui, not in the actual PlayerGui. The StarterGui is only replicated to the client on respawn. |
|
|
| Report Abuse |
|
|
Smeers
|
  |
| Joined: 14 Feb 2013 |
| Total Posts: 797 |
|
|
| 24 Jul 2016 01:16 PM |
If you don't know what localscripts are, you need to learn a bit more before you script too much or you'll basically keep using the same code via memory (instead of learning), which is never good.
I mean no disrespect in this reply.
Try the wiki. |
|
|
| Report Abuse |
|
|
|
| 24 Jul 2016 01:17 PM |
| I know what localscripts but nevermind lol |
|
|
| Report Abuse |
|
|
|
| 24 Jul 2016 02:23 PM |
This is what I have currently for the script [Updated version]
--[[ Scripted by Godlydeathdragon ]]-- local guiTriggered = script.Parent local Gui1Image = game.Players.LocalPlayer.PlayerGui:WaitForChild('Gui1').ImageLabel
debounce = false
guiTriggered.Touched:connect(function(hit) h = hit.Parent:FindFirstChild('Humanoid') h.WalkSpeed = 50 h.JumpPower = 50 wait(1) if debounce == false then debounce = true Gui1Image:TweenPosition(UDim2.new(-0.043, 0, -0.042, 0), 'Out', 'Bounce', 1) wait(3) Gui1Image:TweenPosition(UDim2.new(-0.743, 0, -0.042, 0), 'Out', 'Bounce', 1) wait(5) debounce = false end end) |
|
|
| Report Abuse |
|
|
| |
|