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: What is wrong with this? EASY

Previous Thread :: Next Thread 
Shockfi is not online. Shockfi
Joined: 22 May 2012
Total Posts: 120
23 May 2012 02:01 PM
Nothing happens when I test, In output all it said was : 16:26:19 - Coin is not a valid member of Part

Here's the coin script just incase it might have to do something with it:
new = script.Parent:clone()

function onTouched(part)

local h = part.Parent:findFirstChild("Humanoid")
if (h~=nil) then
local thisplr = game.Players:findFirstChild(h.Parent.Name)
if (thisplr~=nil) then
local stats = thisplr:findFirstChild("leaderstats")
if (stats~=nil) then
local score = stats:findFirstChild("Block_Tokens")
if (score~=nil) then
wait()
thisplr.PlayerGui.WarningGUI.Message.Visible = true
script.Parent:destroy()
score.Value = score.Value + 1

local playr2 = part.Parent:findFirstChild("Torso")
playr2.CFrame = CFrame.new(game.Workspace.Checkpoints.Checkpoint3.Position) -- Don't forget to change this.
wait(4)
new.Parent = game.Workspace
thisplr.PlayerGui.WarningGUI.Message.Visible = false

if score.Value == 1 then
thisplr.PlayerGui.ReturnGUI.Message.Visible = true
script.Disabled = true
playr2.CFrame = CFrame.new(game.Workspace.Checkpoints.Checkpoint3.Position) -- and this
thisplr.PlayerGui.ReturnGUI.Message.Visible = false

end
end
end
end
end
end

script.Parent.Touched:connect(onTouched)

Here's the undisable script:
while true do
if game.Workspace.Part.Coin.Disabled = true then
wait(2)
game.Workspace.Part.Coin.Disabled = false
end
end
Report Abuse
Firebrand1 is not online. Firebrand1
Joined: 12 Feb 2009
Total Posts: 2692
23 May 2012 02:30 PM
This won't work if there are multiple "Part"s in your game. It means the Part it's looking in doesn't have "Coin".
Report Abuse
RyanDolan123 is not online. RyanDolan123
Joined: 05 Mar 2009
Total Posts: 17919
23 May 2012 06:09 PM
Your undisable script will crash the game. At least add a wait(0) after the while true do
It's weird, I know.
Report Abuse
RyanDolan123 is not online. RyanDolan123
Joined: 05 Mar 2009
Total Posts: 17919
23 May 2012 06:16 PM
Try this undisabling script:

while true do wait(0)
a = Workspace:GetChildren()
for i = 1, #a do if a[i].Name == "Part" then
if a[i]:FindFirstChild("Coin") ~= nil then
if a[i].Coin.Disabled == true then
a[i].Coin.Disabled = false
end end end end end
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