hello
I need help in my game
my game is [obby game]
the problom: when player touch the coins the coins Destroy for any player
what i want: when the player touch the coins only Destroy for 1 player
the script:
local coinsbug1 = game.Workspace.coins1
local coinsbug2 = game.Workspace.coins2
local coinsbug3 = game.Workspace.coins3
local coinsbug4 = game.Workspace.coins4
local coinsbug5 = game.Workspace.coins5
local mucoins = game.StarterPlayer.StarterCharacterScripts.coinsvalue
local plr = game.Workspace.Part13
local coins = game.Players.LocalPlayer.lod.coins
coinsbug1.coinsbug.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") and game.StarterPlayer.StarterCharacterScripts.coinsvaluebug1.Value == true then
print("its work")
coins.Value = coins.Value+3*mucoins.Value
game.Workspace.coins1.coinsbug.CanTouch = false
game.Workspace.coins1.DeleteThis.Position = Vector3.new(-590.533, 13.233, 581.946)
game.Workspace.coins1.thype.Position = Vector3.new(-590.533, 13.233, 581.946)
game.Workspace.coins1.coinswork:MoveTo(Vector3.new(-590.533, 13.233, 581.946))
game.StarterPlayer.StarterCharacterScripts.coinsvaluebug1.Value = false
script.Parent.huggui.Framegu.coinsimg1.Visible = false
end
end)
coinsbug5.coinsbug.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") and game.StarterPlayer.StarterCharacterScripts.coinsvaluebug5.Value == true then
coins.Value = coins.Value+5*mucoins.Value
game.Workspace.coins5.coinsbug.CanTouch = false
game.Workspace.coins5.DeleteThis.Position = Vector3.new(-590.533, 13.233, 581.946)
game.Workspace.coins5.thype.Position = Vector3.new(-590.533, 13.233, 581.946)
game.Workspace.coins5.coinswork:MoveTo(Vector3.new(-590.533, 13.233, 581.946))
game.StarterPlayer.StarterCharacterScripts.coinsvaluebug5.Value = false
script.Parent.huggui.Framegu.coinsimg2.Visible = false
end
end)
coinsbug2.coinsbug.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") and game.StarterPlayer.StarterCharacterScripts.coinsvaluebug2.Value == true then
coins.Value = coins.Value+7*mucoins.Value
game.Workspace.coins2.coinsbug.CanTouch = false
game.Workspace.coins2.DeleteThis.Position = Vector3.new(-590.533, 13.233, 581.946)
game.Workspace.coins2.thype.Position = Vector3.new(-590.533, 13.233, 581.946)
game.Workspace.coins2.coinswork:MoveTo(Vector3.new(-590.533, 13.233, 581.946))
game.StarterPlayer.StarterCharacterScripts.coinsvaluebug2.Value = false
script.Parent.huggui.Framegu.coinsimg3.Visible = false
end
end)
coinsbug3.coinsbug.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") and game.StarterPlayer.StarterCharacterScripts.coinsvaluebug3.Value == true then
coins.Value = coins.Value+10*mucoins.Value
game.Workspace.coins3.coinsbug.CanTouch = false
game.Workspace.coins3.DeleteThis.Position = Vector3.new(-590.533, 13.233, 581.946)
game.Workspace.coins3.thype.Position = Vector3.new(-590.533, 13.233, 581.946)
game.Workspace.coins3.coinswork:MoveTo(Vector3.new(-590.533, 13.233, 581.946))
game.StarterPlayer.StarterCharacterScripts.coinsvaluebug3.Value = false
script.Parent.huggui.Framegu.coinsimg4.Visible = false
end
end)
coinsbug4.coinsbug.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") and game.StarterPlayer.StarterCharacterScripts.coinsvaluebug4.Value == true then
coins.Value = coins.Value+25*mucoins.Value
game.Workspace.coins4.coinsbug.CanTouch = false
game.Workspace.coins4.DeleteThis.Position = Vector3.new(-590.533, 13.233, 581.946)
game.Workspace.coins4.thype.Position = Vector3.new(-590.533, 13.233, 581.946)
game.Workspace.coins4.coinswork:MoveTo(Vector3.new(-590.533, 13.233, 581.946))
game.StarterPlayer.StarterCharacterScripts.coinsvaluebug4.Value = false
hit.Parent:FindFirstChild("HumanoidRootPart").CFrame = CFrame.new(plr.CFrame.X,plr.CFrame.Y+5,plr.CFrame.Z)
game.StarterPlayer.StarterCharacterScripts.portalValue1.Value = false
game.StarterPlayer.StarterCharacterScripts.portalValue5.Value = false
game.StarterPlayer.StarterCharacterScripts.portalValue2.Value = false
game.StarterPlayer.StarterCharacterScripts.portalValue3.Value = false
game.StarterPlayer.StarterCharacterScripts.portalValue4.Value = false
end
end)
while wait( ) do
if game.StarterPlayer.StarterCharacterScripts.portalValue1.Value == false then
if game.StarterPlayer.StarterCharacterScripts.coinsvaluebug1.Value == false then
game.Workspace.coins1.DeleteThis.Position = Vector3.new(-305.329, 13.233, 581.946)
game.Workspace.coins1.thype.Position = Vector3.new(-305.329, 13.233, 581.946)
game.Workspace.coins1.coinswork:MoveTo(Vector3.new(-305.329, 13.233, 581.946))
game.Workspace.coins1.coinsbug.CanTouch = true
script.Parent.huggui.Framegu.coinsimg1.Visible = true
game.StarterPlayer.StarterCharacterScripts.coinsvaluebug1.Value = true
end
end
if game.StarterPlayer.StarterCharacterScripts.portalValue5.Value == false then
if game.StarterPlayer.StarterCharacterScripts.coinsvaluebug5.Value == false then
game.Workspace.coins5.DeleteThis.Position = Vector3.new(-259.446, 27.672, 649.87)
game.Workspace.coins5.thype.Position = Vector3.new(-259.446, 27.672, 649.87)
game.Workspace.coins5.coinswork:MoveTo(Vector3.new(-259.446, 27.672, 649.87))
game.StarterPlayer.StarterCharacterScripts.coinsvaluebug5.Value = true
game.Workspace.coins5.coinsbug.CanTouch = true
script.Parent.huggui.Framegu.coinsimg2.Visible = true
end
end
if game.StarterPlayer.StarterCharacterScripts.portalValue2.Value == false then
if game.StarterPlayer.StarterCharacterScripts.coinsvaluebug2.Value == false then
game.Workspace.coins2.DeleteThis.Position = Vector3.new(-177.443, 41.089, 634.244)
game.Workspace.coins2.thype.Position = Vector3.new(-177.443, 41.089, 634.244)
game.Workspace.coins2.coinswork:MoveTo(Vector3.new(-177.443, 41.089, 634.244))
game.StarterPlayer.StarterCharacterScripts.coinsvaluebug2.Value = true
script.Parent.huggui.Framegu.coinsimg3.Visible = true
game.Workspace.coins2.coinsbug.CanTouch = true
end
end
if game.StarterPlayer.StarterCharacterScripts.portalValue3.Value == false then
if game.StarterPlayer.StarterCharacterScripts.coinsvaluebug3.Value == false then
game.Workspace.coins3.DeleteThis.Position = Vector3.new(-217.788, 54.137, 552.195)
game.Workspace.coins3.thype.Position = Vector3.new(-217.788, 54.137, 552.195)
game.Workspace.coins3.coinswork:MoveTo(Vector3.new(-217.788, 54.137, 552.195))
game.StarterPlayer.StarterCharacterScripts.coinsvaluebug3.Value = true
game.Workspace.coins3.coinsbug.CanTouch = true
script.Parent.huggui.Framegu.coinsimg4.Visible = true
end
end
if game.StarterPlayer.StarterCharacterScripts.portalValue4.Value == false then
if game.StarterPlayer.StarterCharacterScripts.coinsvaluebug4.Value == false then
game.Workspace.coins4.DeleteThis.Position = Vector3.new(-254.435, 62.737, 542.695)
game.Workspace.coins4.thype.Position = Vector3.new(-254.435, 62.737, 542.695)
game.Workspace.coins4.coinswork:MoveTo(Vector3.new(-254.435, 62.737, 542.695))
game.StarterPlayer.StarterCharacterScripts.coinsvaluebug4.Value = true
game.Workspace.coins4.coinsbug.CanTouch = true
end
end
end