If you are changing it through client, instead fire a remote event to the server and change value from there.
ok ill do that and check rn
char limit
if u send value from client side its not gona work , u need to use event in order to send value from client side to the server side .
If you want the map to be visible only to you, you need to use a client script instead of a server-side script. Server-side scripts allow all players to see what you’re doing. I assume you’re making an admin panel?
is this supposed to work or not cuz its not
local replicatedStorage = game:GetService("ReplicatedStorage")
local mapValue = replicatedStorage:WaitForChild("Map")
local baseplateevent = replicatedStorage.MapChangingRemotes.Baseplate
local crossroadevent = replicatedStorage.MapChangingRemotes.Crossroad
baseplateevent.OnServerEvent:Connect(function()
mapValue.Value = "Baseplate"
end)
baseplateevent.OnServerEvent:Connect(function()
mapValue.Value = "Crossroad"
end)
no i want the map to be visible to all players because its a 1 player game, its not a admin panel its a animation game if u know what those are
Look, on client when player clicks on a button fire a remote event from the client with the name of the button(name of map) and then recieve it on server and change it based on that, send me ur local script and i will fix it.
this is for the crossroads button:
local mapvalue = game.ReplicatedStorage.Map
local choicevalue = script.Parent.Map
local event = game.ReplicatedStorage.MapChangingRemotes.Crossroad
script.Parent.MouseButton1Click:Connect(function()
event:FireServer()
end)
for baseplate:
local mapvalue = game.ReplicatedStorage.Map
local choicevalue = script.Parent.Map
local event = game.ReplicatedStorage.MapChangingRemotes.Baseplate
script.Parent.MouseButton1Click:Connect(function()
event:FireServer()
end)
Alright i noticed that you used same event twice, try this server script:
local replicatedStorage = game:GetService("ReplicatedStorage")
local mapValue = replicatedStorage:WaitForChild("Map")
local baseplateevent = replicatedStorage.MapChangingRemotes.Baseplate
local crossroadevent = replicatedStorage.MapChangingRemotes.Crossroad
baseplateevent.OnServerEvent:Connect(function(plr)
mapValue.Value = "Baseplate"
end)
crossroadevent.OnServerEvent:Connect(function(plr)
mapValue.Value = "Crossroad"
end)
tsym the map is now changing on the button changes
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.