well I was gonna use the local script for gui stuff thats why I have those
@soprosostupid is there a easier way I can just make the character spawn in with a tool equipped and not able to unequip it that will not break the onserverevent part?
I think a easy way is just to parent the tool into the playerâs character. About making a tool not unequipable, try a localscript under the tool,
script.Parent:GetPropertyChangedSignal("Parent"):Connect(function()
script.Parent.Parent = game.Players.LocalPlayer.Character
end
Maybe adjust LocalPlayer with the player you desire in a server script if this doesnât work.
As for the remote event, as Iâve said earlier itâs not required.
If you donât want a player to unequip a tool then there isnât an easy way to do so that Iâm aware of unfortunately. The only way to do so that Iâm aware of is to use ContextActionService to handle the function instead of a tool and then weld the handle part to the characterâs hand to simulate the player holding the tool
I think there will be better ways to disable tool unequip though, just like game Bee Swarm Simulator. I will check and test some possible methods later.
Actually you can simply do
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack,false)
in a localscript. I thought this only disables the gui butâŚ
oh yes I could do that now i just need to find a way to equip the tool when the player join/character added.
To do that itâs fairly simple, you can simply do
game.Players.PlayerAdded:Connect(function(plr)
local char = plr.CharacterAdded:Wait()
local tool = game.ServerStorage:WaitForChild("Tool"):Clone() --You can also store in repstorage, but that's not safe
tool.Parent = char
end)
in a normal script in serverscriptservice.
I tested with this method and remote events are working all fine. But anyways you wonât need the remote event.
yeah this works but the OnServerEvent still wont work.
Not really, I tested with the same thing, I did use remote events without any problems. Btw your remote event is not required.
Can you please show me all the descendants of the tool in serverstorage or where itâs stored? Thereâs no reason it wonât work as itâs working totally fine with me.
robloxapp-20231203-2106033.wmv (646.0 KB)
Have you really looked at our discussions? The remote event is not necessary and may cause performance issues, you dont need it.
i feel stupid I added a task.wait in my first script and everything works perfectly fine now.
so ig the tool was equipping before the character loaded
You can just do local character = game.Players.LocalPlayer.CharacterAdded:Wait()
at the start of your local script, thatâs better than a task.wait()