|
| 08 Jun 2015 11:18 PM |
--Put this in a Gui Button
plr = game.Players.LocalPlayer
script.Parent.MouseButton1Click:connect(function() pcall(function() local Pos = plr.Character:GetPrimaryPartCFrame() plr:LoadCharacter() plr.Character:SetPrimaryPartCFrame(Pos) if plr.Character:FindFirstChild("ForceField") then plr.Character["ForceField"]:Destroy() end end) end) |
|
|
| Report Abuse |
|
|
| |
|
|
| 09 Jun 2015 11:06 AM |
LocalScript or ServerScript?
Enjoying your stay at the Scripters Forum? Join this! http://www.roblox.com/My/Groups.aspx?gid=2582784 |
|
|
| Report Abuse |
|
|
|
| 09 Jun 2015 11:07 AM |
| localscript in a gui button |
|
|
| Report Abuse |
|
|
|
| 09 Jun 2015 11:22 AM |
| This is really important 2 meh game |
|
|
| Report Abuse |
|
|
|
| 09 Jun 2015 11:34 AM |
This on works but i really need the click gui to work.
Keywords = {":normal", ":refresh"}
game.Players.PlayerAdded:connect(function(plr) plr.Chatted:connect(function(msg) for _, v in pairs(Keywords) do if v:lower() == msg:lower() then pcall(function() local Pos = plr.Character:GetPrimaryPartCFrame() plr:LoadCharacter() plr.Character:SetPrimaryPartCFrame(Pos) if plr.Character:FindFirstChild("ForceField") then plr.Character["ForceField"]:Destroy() end end) end end end) end) |
|
|
| Report Abuse |
|
|
|
| 09 Jun 2015 11:36 AM |
| add a wait() at the very top |
|
|
| Report Abuse |
|
|
|
| 09 Jun 2015 11:38 AM |
still nothing
--Put this in a Gui Button
plr = game.Players.LocalPlayer
script.Parent.MouseButton1Click:connect(function() wait() pcall(function() local Pos = plr.Character:GetPrimaryPartCFrame() plr:LoadCharacter() plr.Character:SetPrimaryPartCFrame(Pos) if plr.Character:FindFirstChild("ForceField") then plr.Character["ForceField"]:Destroy() end end) end) |
|
|
| Report Abuse |
|
|
|
| 09 Jun 2015 11:50 AM |
| You can't use LoadCharacter in a LocalScript. |
|
|
| Report Abuse |
|
|
|
| 09 Jun 2015 12:27 PM |
| so what would you do to make this work |
|
|
| Report Abuse |
|
|
|
| 09 Jun 2015 01:15 PM |
| yes you can and op do you not understand what very top means i mean this is already a freemodel just work with me man put the wait() above plr |
|
|
| Report Abuse |
|
|
|
| 09 Jun 2015 01:24 PM |
"yes you can" No, you can't use LoadCharacter in a LocalScript. Read the wiki, test it yourself, do whatever, but I'm right on this one. This isn't the first time I've had someone argue that you can use it. You can't use it in a LocalScript! |
|
|
| Report Abuse |
|
|
|
| 09 Jun 2015 01:26 PM |
Just use a RemoteEvent.
:FireServer() when you want to :LoadCharacter.
.OnServerEvent(player) when you want to receive it.
Enjoying your stay at the Scripters Forum? Join this! http://www.roblox.com/My/Groups.aspx?gid=2582784 |
|
|
| Report Abuse |
|
|