ServerScriptService issue?

I am not going to share the code because there is just a lot of script, this is more of a fundamental question/issue. I have a server script in serverscriptservice that is attempting to change the ShirtTemplate of a shirt in workspace. I ran print statements and everything looks normal like it should be working but the shirt does not appear on the Shirt. I have ran all sorts of troubleshooting and I can’t solve this.

When I check the workspace after the code has ran, the ShirtTemplate has changed and is correct in properties, but there is no visual change.

I tried to apply the same thing but with a part color, and yet again there is no change, but everything looks normal in workspace and output…

My only guess is that maybe a script in serverscriptservice can’t make these changes? I’m not really sure…

1 Like
  1. Server-Side Script: A server-side script (like one in ServerScriptService) handles game logic, data storage, communication between players, etc. It can update data, trigger events, and communicate with clients.
  2. Client-Side Script: A client-side script runs on each player’s client. It handles things like animations, UI, and updating visuals. It can respond to events sent from the server, but it’s what actually changes what players see on their screens.

If you’re trying to make visual changes in the Workspace, you need to use a client-side script, typically placed in StarterPlayerScripts or similar, to make those changes on the player’s individual client.

Here’s a simplified example of how you might approach this:

  1. Server-Side Script (ServerScriptService):
  • The server-side script handles the logic of when a change needs to occur.
  • It sends a signal to the clients indicating that a change should happen.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ChangeRequest = Instance.new("RemoteEvent")
ChangeRequest.Name = "ChangeRequest"
ChangeRequest.Parent = ReplicatedStorage
  1. Client-Side Script (StarterPlayerScripts):
  • The client-side script listens for the signal from the server.
  • When it receives the signal, it makes the visual change in the Workspace.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ChangeRequest = ReplicatedStorage:WaitForChild("ChangeRequest")

ChangeRequest.OnClientEvent:Connect(function()
    local shirt = workspace:WaitForChild("Shirt") -- Replace with your object name
    -- Modify the visual properties of the object
    -- For example:
    shirt.Color = Color3.new(1, 0, 0) -- Red
end)

Remember, for each player, the client-side script will run independently on their client, making the necessary visual changes.

2 Likes

Thank you, this helped a lot. This is exactly what I had suspected.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.