Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Im struggling to work with Fireservers?

Asked by 5 years ago

im using a fire server to tell the game that a player has dropped an item in their inventory, but i dont know what im doing wrong (maybe its the RequestDrop:FireServer() or the local function onDropFired(player)

here it is:

Local Script:

local RequestDrop = script.Parent.RequestDrop
player = game.Players.LocalPlayer

script.Parent.MouseButton1Click:connect(function()
print (player.Name,"wants to drop an item!")
RequestDrop:FireServer()

end)

Script:

local drop = game.ReplicatedStorage.stuff.wood.drop
local clone = drop:Clone()
local RequestDrop = script.Parent.RequestDrop

local function onDropFired(player)
print(player.Name, "has dropped an item")
clone.Parent = game.Workspace
clone.CFrame = CFrame.new(player.Character.HumanoidRootPart.Position)
clone.Transparency = 0
clone.Anchored = false  
clone.CanCollide = true
clone.Script.Disabled = false
 script.Parent:Destroy()
end
RequestDrop.OnServerEvent:Connect(onDropFired)

really new to this whole fire server thing, any help would be nice!

0
You have to reference your RemoteEvent's name and use that to fireserver. Sorukan 240 — 5y
0
what? i have referenced it, idk what you're talking about, could you go into more detail? StormcloakGuard 30 — 5y
0
first, describe what's going wrong and where you placed both scripts theking48989987 2147 — 5y
0
the scripts are inside replicated storage that with the script, it links to the "stuff" folder. when i click the gui button that is in the inventory, it does nothing and no event is sent for im using fireservers for this and its probably because of the function or the fireevent being sent StormcloakGuard 30 — 5y
View all comments (3 more)
0
Place the local script in the gui with the, put the server script in server script service, put the event in replicated storage, and fix the variables that link to everything. The locations for everything are all over the place, and you should be able to see they aren't working in the console Warfaresh0t 414 — 5y
0
oh ok lol thanks StormcloakGuard 30 — 5y
0
scripts in replicated storage don't run :p theking48989987 2147 — 5y

Answer this question