Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

My Simulator Door for next area is broken how do I go about fixing? (READ DESC)

Hi so I really want to be a scripter but I cant ngl I use FM sometimes I can't and here is a script I tried but no luck this would really help me if you looked and it. How do I fix it and how to make it take away money and SAVE on rejoin? Edit script all you need this will be helpfully stay safe wash your hands!

script.Parent.Touched:Connect(function(hit)
	local human = hit.Parent:FindFirstChild("Humanoid")
	if human ~= nil then
		local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
		if plr.leaderstats.Money.Value >= 100 then
			script.Parent.Transparency = .5
			script.Parent.CanCollide = false
			
			wait(.5)
			script.Parent.Transparency = 0
			script.Parent.CanCollide = true
		end
	end
end)

1 comment

0

Is it local script

2 answers

✓ Accepted answer

I think this is correct

script.Parent.Touched:Connect(function(hit)
    local plr = hit
    if plr.leaderstats.Money.Value >= 100 then
            script.Parent.Transparency = .5
            script.Parent.CanCollide = false

            wait(.5)
            script.Parent.Transparency = 0
            script.Parent.CanCollide = true
end
end)

6 comments

0

Sorry but it did not work.

0

try it again i've edited it

0

It still is not working there is a red line under end on the last end.

0

This might've fixed it

0

Thanks but I found another one I am about to ask another question if you can help?

0

ok

Here is my guess:

script.Parent.Touched:Connect(function()
local plr =  game.Players:FindFirstChild(hit.Parent.Name)
if not plr then return end
if plr then
if  plr.Leaderstats.Money.Value >= 100  then
script.Parent.Transparency = 0.5
script.Parent.CanCollide = false

wait(0.5)

script.Parent.Transparency = 1
script.Parent.CanCollide = true
    end
end
end)

1 comment

0

Its ok but it did not work either

This discussion is preserved as it was. New answers, comments, and votes are closed.