What do you want to achieve? Get a model in ServerStorage. So i can show the hit box of it.
What is the issue? Im getting this error 21:49:53.569 - Coin is not a valid member of ServerStorage "ServerStorage"
What solutions have you tried so far? I have checked my code and I am calling the correct model but I still get the error here is my code incase the error is in the code
local debounce = false
script.Parent.MouseButton1Click:Connect(function()
if debounce == false then
debounce = true
game.ServerStorage.Coin.PrimaryPart.Transparency = .5
for i, coinspawn in pairs(workspace.CoinSpawns:GetChildren()) do
if coinspawn:FindFirstChild("Coin") then
coinspawn.Coin.PrimaryPart.Transparency = .5
end
end
else
debounce = false
game.ServerStorage.Coin.PrimaryPart.Transparency = 1
for i, coinspawn in pairs(workspace.CoinSpawns:GetChildren()) do
if coinspawn:FindFirstChild("Coin") then
coinspawn.Coin.PrimaryPart.Transparency = 1
end
end
end
end)
Where is this script being executed, on the client or the server?
Please remember that objects in ServerStorage cannot be retrieved from the client. You must use a remote event to access objects like that from the client.
Unless you only want this change to appear for 1 player instead of all players in the server, you should use a remote event to modify the properties of server-side objects.
No problem! If you want it to show locally, I suggest using the ReplicatedStorage as objects in there can be modified/accessed by both the server and the client. However, if you modify something in ReplicatedStorage from the client, then it will only be displayed for that client which I believe is what you’re trying to achieve.
oh ok also thank you for the help i know how to script just dont know how some of the starter things in a new game work i really need to read more of the Dev API