Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

What is wrong with this cloning script?

Asked by
RoyMer 301 Moderation Voter
8 years ago

What is wrong with this script?

local player = game.Players.LocalPlayer
function onTouch()

if player.PlayerGui.Ready.Value == true then

if player.ds.Worn1.Value == 1 then
local clone = game.ServerStorage.Scripts.Clone.Animals.Test:Clone()
clone.Parent = player.Character

player.PlayerGui.Ready.Value = false
end
end
end

script.Parent.Touched:connect(onTouch)
0
It seems as if one of the if statements is not firing so the code will not occur Mystdar 352 — 8y
0
Is this a localscript? HungryJaffer 1246 — 8y
0
It is not a local script, though I tried with local script but still didn't work RoyMer 301 — 8y

1 answer

Log in to vote
0
Answered by
KenzaXI 166
8 years ago
function onTouch(Brick)
local Player  =
Brick.Parent:findFirstChild("Humanoid")
if Player.PlayerGui.Ready.Value == true then

if Player.ds.Worn1.Value == 1 then
local clone = game.ServerStorage.Scripts.Clone.Animals.Test:Clone().Parent = Player.Character

Player.PlayerGui.Ready.Value = false
end
end
end

script.Parent.Touched:connect(onTouch)

0
Something is not right in line 7 :( RoyMer 301 — 8y
0
I edited the script try it now. KenzaXI 166 — 8y
0
Still there seems to be something wrong in line 7 as the "Parent = player.Character", the "=" is marked red. RoyMer 301 — 8y
0
Try now, The Local said "Player" But in the script I put "player" I fixed it now, so it should work. KenzaXI 166 — 8y
Ad

Answer this question