I run the game with this in a script I get an error for it needs to be a localscript because I am firing a RemoteEvent. In a local script nothing happen at all when player touches the part.
local rS = game:GetService("ReplicatedStorage") local Reward10k = rS.RemoteEvents:WaitForChild("Reward10k") local Reward20k = rS.RemoteEvents:WaitForChild("Reward20k") math.randomseed(tick()) script.Parent.Touched:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then script.Disabled = true local player = hit.Parent.Name local num = 0 for i = 1,45 do wait() script.Parent.CFrame = ( CFrame.new(script.Parent.Position) * CFrame.Angles(0,math.rad(num),0) ) script.Parent.CFrame = ( CFrame.new(script.Parent.Position) * CFrame.Angles(0,math.rad(num),0) ) num = num + 8 end num = 0 local random = math.random(1,100) if random > 0 and random < 50 then Reward10k:FireServer() print("10K") elseif random > 50 and random < 100 then Reward20k:FireServer() print("20K") end script.Parent:Destroy() end end)