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

The localscript works in roblox solo mode and not in game/server?

Asked by 6 years ago
01local Player = game.Players.LocalPlayer
02local Mouse = Player:GetMouse()
03script.PlayerName.Value = game.Players.LocalPlayer.Name
04Mouse.KeyDown:connect(function(Key)
05    if Key:byte() == 32 then
06        if Player.Character.Parent ~= game.Workspace then
07            for _, descendant in    pairs(game.Workspace.FlightModel:GetDescendants())do
08                if descendant.Name == script.PlayerName.Value then
09                    descendant.Parent = game.Workspace
10                end
11            end
12        end
13    end
14end)

1 answer

Log in to vote
2
Answered by 6 years ago

This is because you scriping doesn't include remoteEvents. RemoteEvents help tranfer data from server to client or client to server. We need to use the Event FireServer. Which will fire your script into the Server which well then be read and be fire into the client aka your game. This allows everyone to see whats going on in game. Here is a youtube video on the fowllowing. if you don't like Remote event you could go into your workspace and turn it off. But if will allow players to hack in your game. Hope i helped :)

0
Quick Question, It doesn't even work in the client in game but works in roblox studio it the tutorial still going to help? FirezoneGamez 155 — 6y
0
This tutoraial will help. GGButNO_RE 61 — 6y
Ad

Answer this question