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

selling script wont work no outpout errors?print wont print??!

Asked by
hokyboy 270 Moderation Voter
5 years ago

okay so i made this sell script but it wont work i used the print to detect the error but it still wont work can some one help me?




local ReplicatedStorage = game:GetService("ReplicatedStorage") local RemoteEvents = ReplicatedStorage.RemoteEvents local Sold = RemoteEvents.ItemSold local Debounce = false script.Parent.Touched:Connect(function(hit) print("Player Touched Part") if hit.Parent:FindFirstChild("Humanoid") then local Player = game.Players:GetPlayerFromCharacter(hit.Parent) if Player.PlayerStats.CurrentValue.Value > 0 then if Debounce == false then Debounce = true Sold:FireClient(Player, Player.PlayerStats.CurrentValue.Value) Player.PlayerStats.Coins.Value = Player.PlayerStats.Coins.Value + Player.PlayerStats.CurrentValue.Value Player.PlayerStats.CurrentValue.Value = 0 wait() Debounce = false end end end end)
0
there's nothing wrong with the script itself, except you have to account for a couple of things. 1. you should use :WaitForChild() for the RemoteEvents variable and the Sold variable. 2. you need to check if Player exists before utilizing it in line 10 Gey4Jesus69 2705 — 5y
0
i did both thoos things it wont work,also else there would be a error there is no error hokyboy 270 — 5y

Answer this question