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

Why is the player only freezing sometimes?

Asked by 8 years ago

So i have this script, it's saposed to freeze the player, clone the gui, and make it so you cannot click it again, the problem is i made 2 of these one time it worked, the other time i could still move

This is a FE Place and is in the workspace(idk if i needed to say that)

gui = script.Parent.HouseChoose

local function onMouseClick(player)
local Character = player.Character or player.CharacterAdded:wait()
script.Parent.ClickDetector.MaxActivationDistance = 0
Character.Humanoid.WalkSpeed = 0
local playergui = player.PlayerGui 
local dgui = gui:Clone()
dgui.Parent = playergui
wait(.5)
dgui.Choose1:TweenPosition(UDim2.new(0.041, 0,0.074, 0))
dgui.Plot.Value = script.Parent.Parent.Parent.Name
end
script.Parent.ClickDetector.MouseClick:connect(onMouseClick)
0
Could it be because you're not using WaitForChild? For the GUI, try making it equal to script.Parent:WaitForChild("HouseChoose") User#11440 120 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

As has been answered in discord...

ClickDetectors don't work directly with FE.

Use this: https://www.roblox.com/FilteringEnabled-ClickDetector-item?id=438047776

or

Read this: https://scriptinghelpers.org/questions/17049/how-would-i-fix-click-detectors-if-filtering-is-enabled

Ad

Answer this question