Remote Event not functioning properly?
My first script detects a change in an int value's value. When the value becomes 0, it fires a remote event to the client.
Server script:
1 | script.Parent:GetPropertyChangedSignal( "Value" ):Connect( function () |
2 | print (script.Parent.Value) |
3 | local val = script.Parent.Value |
6 | game.ReplicatedStorage.RemoteEvent:FireAllClients() |
The problem is, is that it doesn't fire the event. Here's my local script:
01 | game.ReplicatedStorage.RemoteEvent.OnClientEvent:Connect( function () |
03 | local plr = game:GetService( "Players" ).LocalPlayer |
04 | local char = plr.Character |
05 | script.Parent.Value = 10 |
06 | char.Humanoid.WalkSpeed = 0 |
08 | char:MoveTo(Vector 3. new(- 20.55 , 19.9 , - 6.46 )) |
09 | game.Workspace.Map 1. Dots:Destroy() |
10 | local ss = game:GetService( "ServerStorage" ) |
11 | local newdot = ss.Dots:Clone() |
12 | newdot.Parent = game.Workspace.Map 1 |
14 | char.Humanoid.WalkSpeed = 16 |
I have no clue why this doesn't work.