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 » Scripting Helpers
Home Search
 

Re: 2 Scripts I need help with.

Previous Thread :: Next Thread 
FailzStrat is not online. FailzStrat
Joined: 22 Dec 2012
Total Posts: 71
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 is not online. 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 is not online. 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 is not online. 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
FailzStrat is not online. FailzStrat
Joined: 22 Dec 2012
Total Posts: 71
02 Jan 2014 03:59 PM
Was this supposed to be a localscript? O.O
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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