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

RemoteEvent is not doing anything?

I have been struggling with this for a while now, looked around and found no answers. I'm new to this but could find nothing of any help after several hours.

Workspace: Script named RemoteStats, RemoteEvent called ChangeStats inside

Level = game.ServerStorage.StatFile.player.statnumbers.Level
LevelValue = game.ServerStorage.StatFile.player.statnumbers.Level.Value
script.ChangeStats.OnServerEvent:connect(function(player)
	Level.Value = Level.Value + 1
	print(LevelValue)
end)

Inside a GUI and localscript

script.Parent.MouseButton1Click:connect(function(player)
	game.Workspace.RemoteStats.ChangeStats:FireServer()
end)

3 comments

1

When you say StatFile.player, is there an actual object called player inside StatFile?

0

Yes, that is one of the problems. If I replace player with a specific name then that part works. But there is also something faulty with the rest of the script too

0

Is player in Level and Level1Value supposed to be the player who fired the remote?

1 answer

Try using this:

Localscript:

script.Parent.MouseButton1Click:connect(function()
    game.Workspace.RemoteStats.ChangeStats:FireServer(script.Parent.Text)
end)

ServerScript

Level = game.ServerStorage.StatFile.player.statnumbers.Level
LevelValue = game.ServerStorage.StatFile.player.statnumbers.Level.Value
script.ChangeStats.OnServerEvent:connect(function(player, text)
    Level.Value = Level.Value + 1
    print(LevelValue)
end)

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