generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: help

Previous Thread :: Next Thread 
stephenthefox is not online. stephenthefox
Joined: 11 Mar 2011
Total Posts: 1123
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 is not online. 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
stephenthefox is not online. stephenthefox
Joined: 11 Mar 2011
Total Posts: 1123
11 Aug 2016 04:22 PM
Thank you.


Report Abuse
494sox is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image