|
| 11 Aug 2016 04:09 PM |
I've worked on this for about 2 weeks and most of it works... The problom I will put under the script... Im trying to make it so that only Admins can click it.
Admins = {15295651,384017,46079440} script.Parent.MouseButton1Down:connect(function() for _,v in ipairs(Admins) do if player.UserId == v then 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)
Outputs: 17:06:29.408 - Workspace.PlaceIdScreen.Screen.SurfaceGui.Frame.Start.Script:5: attempt to index local 'player' (a number value) 17:06:29.408 - Stack Begin 17:06:29.409 - Script 'Workspace.PlaceIdScreen.Screen.SurfaceGui.Frame.Start.Script', Line 5 17:06:29.410 - Stack End
|
|
|
| Report Abuse |
|
|
JoshRBX
|
  |
| Joined: 19 May 2012 |
| Total Posts: 8778 |
|
|
| 11 Aug 2016 04:13 PM |
Where have you told the script what 'player' is?
Add this
local player = nil
--your code
function plrEntered(plr) player = plr end
game.Players.PlayerAdded:connect(plrEntered) |
|
|
| Report Abuse |
|
|
| |
|
494sox
|
  |
| Joined: 30 Jul 2010 |
| Total Posts: 50 |
|
|
| 11 Aug 2016 04:23 PM |
| Try seeing if there's a way to detect the player who clicked. I know that it's possible with Touched with "hit" [ Part.Touched:connect(function(hit) ], but I don't know about click detectors. If it is not possible, try to move everything to a LocalScript and try from there. (Won't work serverside aka in workspace, needs to be in the actual player) |
|
|
| Report Abuse |
|
|