This is what I have on my script right now. What i want it to do is make the folder value be true only if the file this is activated. But when I run this in my game it instantly makes the folder value true. How do I fix this?
01 | local this = script.Parent |
02 |
03 | game.Players.PlayerAdded:connect ( function (plr) |
04 |
05 | local folder = Instance.new ( "BoolValue" ,workspace) |
06 | folder.Name = (plr.Name .. "click" ) |
07 |
08 | if this.Activated then |
09 | folder.Value = true |
10 | end |
11 | end ) |
You don't handle PlayerAdded from a LocalScript. Just use a LocalScript and use the LocalPlayer.
1 | --LocalScript |
2 |
3 | script.Parent.MouseButton 1 Click:Connect( function () |
4 | print (game:GetService( "Players" ).LocalPlayer.Name) |
5 | end ) |
Organization is essential.
01 | --Made by Lunatic_o |
02 | -- I don't know if it will work. (I'm on mobile) |
03 |
04 | local this = script.Parent |
05 | this.Activated = false |
06 |
07 | function CheckThis() |
08 |
09 | if assert (this.Activated) then |
10 | print ( "This is Activated" ) |
11 | workspace.YoutFolder.Value = true |
12 | end |
13 | end |
14 |
15 |