|
| 15 Aug 2016 01:10 PM |
This only prints Boat started but doesnt do anything else... Can i get some help? (Nothing is in the outputs besides Boat started
Admins = {15295651} game.Players.PlayerAdded:connect (function(plr) player = plr end) script.Parent.MouseButton1Down:connect(function() print("Boat Started") for _,v in ipairs(Admins) do if player.UserId ~= v then return end if player.UserId == v then print("Admin Clicked it") wait(5) game.Workspace.MovingBoat.Horn:Play() wait(2.81) game.Workspace.MovingBoat.Horn:Play() wait(2.81) game.Workspace.MovingBoat.Horn:Play() wait(5) game.Workspace.MovingBoat.Boat:Play() if workspace.MovingBoat.GoingDown.Value == true or workspace.MovingBoat.GoingUp.Value == true then return end if workspace.MovingBoat.Up.Value == true then workspace.MovingBoat.GoingDown.Value = true for i= 1,600000000000 do lol = workspace.MovingBoat.Model.MoveParts:GetChildren() for b = 1, #lol do if lol[b].className == "Part" or "Union" or "Model"then lol[b].CFrame = lol[b].CFrame + Vector3.new(-1,0,0) end end wait(0.0001) end workspace.MovingBoat.GoingDown.Value = false workspace.MovingBoat.Up.Value = false workspace.MovingBoat.Down.Value = true end end end end)
|
|
|
| Report Abuse |
|
|
| |
|
|
| 15 Aug 2016 01:36 PM |
| is this in a local script or script and where is it parented to? |
|
|
| Report Abuse |
|
|
| |
|
|
| 15 Aug 2016 01:48 PM |
| if this is parented to a descendant of the player, it needs to be in a local script |
|
|
| Report Abuse |
|
|
|
| 15 Aug 2016 01:50 PM |
Its not parented to any players. It moving an object on click... But I only want it to work if an admin clicks it
|
|
|
| Report Abuse |
|
|
|
| 15 Aug 2016 01:53 PM |
"game.Players.PlayerAdded:connect (function(plr) player = plr end) "
this sets player to the most recent player to join the game
because player is not an argument of MouseButton1Down, you need to create individual surface GUIs for every player, parent it to the playergui, and set the Adornee to whatever part you want
that way you can use the localplayer as your player argument |
|
|
| Report Abuse |
|
|