✓ Accepted answer
Locals scripts don't work when it is in a part on workspace I think. What I've done here is you put the part that you want to walk through and put it in ReplicatedStorage. Create a local script and put it in StarterGui.
local leaderstarts = game.Players.LocalPlayer:WaitForChild("leaderstats"):WaitForChild("Cash")
local part = game.ReplicatedStorage.Part
local clone = part:Clone()
clone.Parent = workspace
db = false
clone.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
if db == false then
db = true
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
if plr.leaderstats.Cash.Value >= 10 then
clone.Transparency = 1
clone.CanCollide = false
print("Your not poor")
wait(1)
clone.Transparency = 0
clone.CanCollide = true
db = false
else
print("Wow your poor")
end
end
end
end)
See if that works. Also, what is happening is cloning the part in the ReplicatedStorage and clones to players individually which only makes the part transparent locally.
1 comment
Also how do I make this look like script so that you can see exactly what I wrote?