|
| 01 Jan 2014 07:59 PM |
You see, I am making a Holo Training for my group, and am making a Quick-Pick model for it. The scripts did Not load the map entitled "Guns". A bit of help?
First Script : function onClicked(player) if player.Name == "FailzStrat" then if game.Workspace:FindFirstChild("Guns") then game.Workspace["Guns"]:remove() end end end
This script, above, was supposed to close the map.
Second Script :
function onClicked(player) if player.Name == "FailzStrat" then if not game.Workspace:FindFirstChild("Guns") then game.Lighting["Guns"]:Clone().Parent = game.Workspace end end end
The script above was supposed to open the map.
Please, I'll even pay ROBUX for a fix, help me. |
|
|
| Report Abuse |
|
|
shawnyg
|
  |
| Joined: 21 Apr 2011 |
| Total Posts: 1428 |
|
|
| 01 Jan 2014 08:04 PM |
script.Parent.MouseButton1Down:connect(function(player) if player.Name == "FailzStrat" then if game.Workspace:FindFirstChild("Guns") then game.Workspace["Guns"]:Remove() end end end)
script.Parent.MouseButton1Down:connect(function(player) if player.Name == "FailzStrat" then if not game.Workspace:FindFirstChild("Guns") then game.Lighting["Guns"]:Clone().Parent = game.Workspace end end end)
Make sure these are in Gui Text buttons
~Hope I helped, if you need a script, PM me first then buy this when I tell you to: http://www.roblox.com/My-Script-Shirt-item?id=118961994~~CAT ★★★★ General Shawnyg~ |
|
|
| Report Abuse |
|
|
shawnyg
|
  |
| Joined: 21 Apr 2011 |
| Total Posts: 1428 |
|
|
| 01 Jan 2014 08:06 PM |
Woops. Forgot to add something in the 2nd script. Here's the fixed one
script.Parent.MouseButton1Down:connect(function(player) if player.Name == "FailzStrat" then if not game.Workspace:FindFirstChild("Guns") then game.Lighting["Guns"]:Clone().Parent = game.Workspace game.Workspace.Guns:MakeJoints() end end end)
~Hope I helped, if you need a script, PM me first then buy this when I tell you to: http://www.roblox.com/My-Script-Shirt-item?id=118961994~~CAT ★★★★ General Shawnyg~ |
|
|
| Report Abuse |
|
|
DataStore
|
  |
| Joined: 07 Feb 2012 |
| Total Posts: 8540 |
|
|
| 01 Jan 2014 08:07 PM |
The "MouseButton1Down" event doesn't pass on the player who clicked the button to the function. It passes on the X and Y of where the button was clicked so therefore "player" is currently equal to where the player clicked the button on the X axis.
To get the player, within a client-side script (LocalScript), you can use the "LocalPlayer" property of the players service (game.Players.LocalPlayer). Alternatively you can parent up to their player. |
|
|
| Report Abuse |
|
|
|
| 02 Jan 2014 03:59 PM |
Was this supposed to be a localscript? O.O
|
|
|
| Report Abuse |
|
|